import { TCrossStair } from "../../../Message/Db/Tables/TCrossStair";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { CopyGradeTask } from "./info/CopyGradeTask";
import { ECopyType } from "../../../Message/Public/ECopyType";
import { ConfigCenter } from "./ConfigCenter";
import { ConfigConst } from "./configBase/ConfigConst";
import { TChaosFightFormula } from "../../../Message/Db/Tables/TChaosFightFormula";
import { TCopy } from "../../../Message/Db/Tables/TCopy";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { DateParser } from "../../common/tools/DateParser";
import { TCopyDropCopyBox } from "../../../Message/Db/Tables/TCopyDropCopyBox";
import { CopySkillInfo } from "./info/CopySkillInfo";
import { TCopyMarkTaskReward } from "../../../Message/Db/Tables/TCopyMarkTaskReward";
import { T60DefenseCopyConfig } from "../../../Message/Db/Tables/T60DefenseCopyConfig";
import { TGuildStruggleConfig } from "../../../Message/Db/Tables/TGuildStruggleConfig";
import { CopyGradeInfo } from "../model/CopyGradeInfo";
import { KingCopyToolTipData } from "../view/copy/kingCopy/info/KingCopyToolTipData";
import { CopyType } from "../view/copy/CopyType";
import { TSeventyCopyConfig } from "../../../Message/Db/Tables/TSeventyCopyConfig";
import { TGuildDefenseUpgrade } from "../../../Message/Db/Tables/TGuildDefenseUpgrade";
type int = number;
//class CopyConfig
    
    export  class CopyConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            this._allCopy = new Array<any>();
            this._copyConfigDic = new Map<any, any> /* flash.utils.Dictionary */();
            this._allCopyDropDic = new Map<any, any> /* flash.utils.Dictionary */();
            this._materials = new Map<any, any> /* flash.utils.Dictionary */();
            this._skills = new Map<any, any> /* flash.utils.Dictionary */();
            this._sixtyDefenceConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._guildStruggleConfig = new Map<any, any> /* flash.utils.Dictionary */();
            this._guildStruggleBossList = new Map<any, any> /* flash.utils.Dictionary */();
            this._copyGradeTaskDic = new Map<any, any> /* flash.utils.Dictionary */();
            this._copyGradeTaskAwardsDic = new Map<any, any> /* flash.utils.Dictionary */();
            this._heroBattleFormula = new Map<any, any> /* flash.utils.Dictionary */();
            if (CopyConfig._instance != null) 
            {
                throw new Error(" CopyConfig 单例 ");
            }
            this.init();
            return;
        }

        public getGuildDefenseDiffArr(): Array<any>
        {
            var loc1=this._copyConfigDic["GuildDefenseDiff"].item;
            if (typeof loc1 === "array") 
            {
                return loc1;
            }
            if (typeof loc1 === "object") 
            {
                return [loc1];
            }
            return [];
        }

        public getGuildDefenseDiffPlayerNum(arg1: int): int
        {
            var loc2=null;
            var loc1=this.getGuildDefenseDiffArr();
            if (loc1 && loc1.length > 0) 
            {
                var loc3=0;
                var loc4=loc1;
                for(loc2 of loc4) 
                {
                    if (loc2["value"] != arg1) 
                    {
                        continue;
                    }
                    return loc2["num"];
                }
            }
            return 0;
        }

        public getGuildDefenseDiffRing(arg1: int): int
        {
            var loc2=null;
            var loc1=this.getGuildDefenseDiffArr();
            if (loc1 && loc1.length > 0) 
            {
                var loc3=0;
                var loc4=loc1;
                for(loc2 of loc4) 
                {
                    if (loc2["value"] != arg1) 
                    {
                        continue;
                    }
                    return loc2["ring"];
                }
            }
            return 0;
        }

        public getCrossStairConfig(arg1: int): TCrossStair
        {
            if (!this._crossStairDic) 
            {
                this.initCrossStairConfig();
            }
            return this._crossStairDic[arg1];
        }

        public getCrossStairTopLayer(): int
        {
            if (!this._crossStairDic) 
            {
                this.initCrossStairConfig();
            }
            return this._crossTopStair;
        }

        /* internal  */initCrossStairConfig(): void
        {
            var loc2=null;
            var loc3=null;
            this._crossStairDic = new Map<any, any> /* flash.utils.Dictionary */();
            var loc1=ConfigManager.instance.getJSONByFileName("t_cross_stair.json");
            var loc4=0;
            var loc5=loc1;
            for(loc3 of loc5) 
            {
                loc2 = new TCrossStair();
                loc2.floor = loc3.floor;
                loc2.killNum = loc3.killNum;
                this._crossStairDic[loc2.floor] = loc2;
                this._crossTopStair = Math.max(this._crossTopStair, loc2.floor);
            }
            return;
        }

        public getRobCopyDesc(arg1: int): string
        {
            var loc2=null;
            var loc3=null;
            var loc1=this._copyConfigDic["RobCopyDescribe"].item;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (loc2["type"] != arg1) 
                {
                    continue;
                }
                return loc3 = (loc3 = (loc3 = loc2["desc"] as string).replace(new RegExp("\\[", "g"), "<")).replace(new RegExp("]", "g"), ">");
            }
            return "";
        }

        public getRobCopyRewards(arg1: int): Array<any>
        {
            var loc2=null;
            var loc3=null;
            var loc1=this._copyConfigDic["RobCopyRewards"].item;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (loc2["type"] != arg1) 
                {
                    continue;
                }
                return (loc3 = loc2["rewards"] as string).split(",");
            }
            return [];
        }

        /* internal  */writeCopyGradeTargetConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new CopyGradeTask();
                loc1.id = loc2.id;
                loc1.markLevel = loc2.markLevel;
                loc1.markTime = loc2.markTime;
                loc1.taskDescribe = loc2.taskDescribe;
                this._copyGradeTaskDic[loc1.id] = loc1;
            }
            return;
        }

        public getSealCopyCodeByLevel(arg1: int): int
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._map;
            for(loc1 of loc3) 
            {
                if (!(loc1.copyType == ECopyType._ECopySeal && loc1.enterMinLevel == arg1)) 
                {
                    continue;
                }
                return loc1.code;
            }
            return 0;
        }

        public getSealCopyOpenDay(arg1: int): int
        {
            var loc1=ConfigCenter.getConfigs(ConfigConst.TLevelSeal, ["level"], [arg1], true);
            if (loc1) 
            {
                return loc1.openNextDay;
            }
            return 30;
        }

        public getHeroBattleDic(arg1: int): TChaosFightFormula
        {
            return this._heroBattleFormula[arg1];
        }

        public getHeroBattleFormula(arg1: Array<any>): int
        {
            var loc2=0;
            var loc3=0;
            var loc4=null;
            var loc5=0;
            var loc1=[];
            var loc6=0;
            var loc7=this._heroBattleFormula;
            for(loc4 of loc7) 
            {
                loc1 = loc4.formula.split("#");
                loc2 = 0;
                loc5 = 0;
                while (loc5 < arg1.length) 
                {
                    if ((loc3 = loc1.indexOf(arg1[loc5])) != -1) 
                    {
                        ++loc2;
                        loc1.splice(loc3, 1);
                    }
                    ++loc5;
                }
                if (loc2 != 3) 
                {
                    continue;
                }
                return loc4.skillId;
            }
            return 0;
        }

        /* internal  */writeHeroBattleConfigs(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TChaosFightFormula();
                loc1.formula = loc2.formula;
                loc1.id = loc2.id;
                loc1.skillId = loc2.skillId;
                this._heroBattleFormula[loc1.skillId] = loc1;
            }
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TCopy();
                loc1.code = loc2.code;
                loc1.copyId = loc2.copyId;
                loc1.name = StringHelper.getString(loc2.name);
                loc1.copyType = loc2.copyType;
                loc1.npc = loc2.npc;
                loc1.bossNum = loc2.bossNum;
                loc1.shortName = StringHelper.getString(loc2.shortName);
                loc1.enterMinLevel = loc2.enterMinLevel;
                loc1.enterMaxLevel = loc2.enterMaxLevel;
                loc1.difficultyNum = loc2.difficultyNum;
                loc1.minPlayer = loc2.minPlayer;
                loc1.maxPlayer = loc2.maxPlayer;
                loc1.enterCdTime = loc2.enterCdTime;
                loc1.startDt = DateParser.strToDate(loc2.startDt);
                loc1.inteval = loc2.inteval;
                loc1.numByDay = loc2.numByDay;
                loc1.openTime = StringHelper.getString(loc2.openTime);
                loc1.stayTime = loc2.stayTime;
                loc1.maps = StringHelper.getString(loc2.maps);
                loc1.intoMapId = loc2.intoMapId;
                loc1.intoX = loc2.intoX;
                loc1.intoY = loc2.intoY;
                loc1.introduction = StringHelper.getString(loc2.introduction);
                loc1.reward = StringHelper.getString(loc2.reward);
                loc1.singleMode = loc2.singleMode;
                loc1.showInHell = loc2.showInHell;
                loc1.outPoint = StringHelper.getString(loc2.outPoint);
                loc1.allDeathByPlayer = loc2.allDeathByPlayer;
                loc1.successType = loc2.successType;
                loc1.successValue = loc2.successValue;
                loc1.successEvent = loc2.successEvent;
                loc1.failType = loc2.failType;
                loc1.failValue = loc2.failValue;
                loc1.failEvent = loc2.failEvent;
                loc1.expConfig = StringHelper.getString(loc2.expConfig);
                loc1.ringRefreshInterval = loc2.ringRefreshInterval;
                loc1.extraDropCost = loc2.extraDropCost;
                loc1.costCoin = loc2.costCoin;
                loc1.costGold = loc2.costGold;
                this._map[loc1.code] = loc1;
                this._allCopy.push(loc1);
            }
            return;
        }

        public writeCopyBox(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TCopyDropCopyBox();
                loc1.copyCode = loc2.copyCode;
                loc1.careerDropCopyBox = StringHelper.getString(loc2.careerDropCopyBox);
                this._allCopyDropDic[loc1.copyCode] = loc1;
            }
            return;
        }

        public writeSixtyCopyConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=0;
            var loc7=0;
            var loc8=0;
            var loc9=arg1;
            for(loc2 of loc9) 
            {
                loc1 = new CopySkillInfo();
                loc1.copyCode = loc2.copyCode;
                loc1.itemCode = loc2.itemCode;
                loc1.pos = loc2.pos;
                loc1.formula = [];
                if (!loc2["formula"] || loc2["formula"] == "") 
                {
                    this._materials[loc1.copyCode + "-" + loc1.pos] = loc1;
                    continue;
                }
                loc4 = [];
                loc6 = (loc5 = StringHelper.getString(loc2.formula) as string).indexOf("[");
                while (loc6 != -1) 
                {
                    if ((loc7 = loc5.indexOf("]", loc6)) == -1) 
                    {
                        break;
                    }
                    loc4.push(loc5.substring(loc6 + 1, loc7));
                    loc6 = loc5.indexOf("[", loc6 + 1);
                }
                loc1.formula = loc4;
                this._skills[loc1.copyCode + "-" + loc1.pos] = loc1;
            }
            return;
        }

        public getHeroBattleMaterial(arg1: string, arg2: string="0"): Array<any>
        {
            var loc1=null;
            var loc2=0;
            var loc3=0;
            var loc5=0;
            var loc6=null;
            var loc4=[];
            var loc7=0;
            var loc8=this._heroBattleFormula;
            for(loc6 of loc8) 
            {
                if (!(loc6.formula.indexOf(arg1) == -1) && arg2 == "0") 
                {
                    loc1 = loc6.formula.split("#");
                    loc2 = loc1.indexOf(arg1);
                    loc5 = 0;
                    while (loc5 < loc1.length) 
                    {
                        if (loc5 != loc2) 
                        {
                            loc4.push(int(loc1[loc5]));
                        }
                        ++loc5;
                    }
                    continue;
                }
                if (!(!(loc6.formula.indexOf(arg1) == -1) && !(loc6.formula.indexOf(arg2) == -1))) 
                {
                    continue;
                }
                loc1 = loc6.formula.split("#");
                loc2 = loc1.indexOf(arg1);
                loc5 = 0;
                if (loc2 == -1) 
                {
                    continue;
                }
                else 
                {
                    loc1.splice(loc2, 1);
                }
                if ((loc3 = loc1.indexOf(arg2)) == -1) 
                {
                    continue;
                }
                else 
                {
                    loc1.splice(loc3, 1);
                }
                loc4.push(int(loc1[0]));
            }
            return this.getArr(loc4);
        }

        /* internal  */writeCopyGradeTaskAwards(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TCopyMarkTaskReward();
                loc1.id = loc2.id;
                loc1.rewardItem = loc2.rewardItem;
                loc1.rewardNum = loc2.rewardNum;
                loc1.taskNum = loc2.taskNum;
                this._copyGradeTaskAwardsDic[loc1.id] = loc1;
            }
            return;
        }

        /* internal  */write60DefenceCopyConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new T60DefenseCopyConfig();
                loc1.id = loc2.id;
                loc1.bossCode = loc2.bossCode;
                loc1.copyCode = loc2.copyCode;
                loc1.desc = loc2.desc;
                loc1.level = loc2.level;
                loc1.showIcon = loc2.showIcon;
                loc1.type = loc2.type;
                loc1.upgradeSocore = loc2.upgradeSocore;
                loc1.useSocore = loc2.useSocore;
                loc1.broadcast = loc2.broadcast;
                this._sixtyDefenceConfig[loc1.copyCode + "_" + loc1.type + "_" + loc1.level] = loc1;
            }
            return;
        }

        /* internal  */writeGuildStruggleConfig(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TGuildStruggleConfig();
                loc1.broadcastEnter = loc2.broadcastEnter;
                loc1.broadcastFail = loc2.broadcastFail;
                loc1.broadcastSuccess = loc2.broadcastSuccess;
                loc1.contribution = loc2.contribution;
                loc1.desc = loc2.desc;
                loc1.difficulty = loc2.difficulty;
                loc1.dropBoss = loc2.dropBoss;
                loc1.expFactor = loc2.expFactor;
                loc1.layer = loc2.layer;
                loc1.limitTime = loc2.limitTime;
                loc1.mapId = loc2.mapId;
                loc1.maxRing = loc2.maxRing;
                loc1.name = loc2.name;
                loc1.ring = loc2.ring;
                loc1.ringAddInterval = loc2.ringAddInterval;
                loc1.targetBosses = loc2.targetBosses;
                loc1.targetItems = loc2.targetItems;
                loc1.timeAdd = loc2.timeAdd;
                loc1.timeBossAdd = loc2.timeBossAdd;
                loc1.timeBossDel = loc2.timeBossDel;
                loc1.timeDel = loc2.timeDel;
                this._guildStruggleConfig[loc1.layer + "_" + loc1.difficulty] = loc1;
                this.updateBossListConfig(loc1);
            }
            return;
        }

        /* internal  */updateBossListConfig(arg1: TGuildStruggleConfig): void
        {
            var loc1=[];
            return;
        }

        /* internal  */writeCopyConfigs(arg1: Object): void
        {
            var loc2=null;
            var loc3=null;
            var loc1=arg1.items as Array<any>;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                loc3 = loc2.type.toString();
                this._copyConfigDic[loc3] = loc2;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_copy.json");
            this.write(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_copy_drop_copy_box.json");
            this.writeCopyBox(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_sixty_copy_config.json");
            this.writeSixtyCopyConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_copy_mark_task.json");
            this.writeCopyGradeTargetConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_copy_mark_task_reward.json");
            this.writeCopyGradeTaskAwards(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_60_defense_copy_config.json");
            this.write60DefenceCopyConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("t_guild_struggle_config.json");
            this.writeGuildStruggleConfig(loc1);
            loc1 = ConfigManager.instance.getJSONByFileName("copyConfig.xml");
            this.writeCopyConfigs(loc1.root);
            loc1 = ConfigManager.instance.getJSONByFileName("t_chaos_fight_formula.json");
            this.writeHeroBattleConfigs(loc1);
            return;
        }

        public getInfoByCode(arg1: int): TCopy
        {
            return this._map[arg1];
        }

        public getInfosByCopyId(arg1: int, arg2: string=null): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            var loc4=this._map;
            for(loc2 of loc4) 
            {
                if (!(loc2.copyId == arg1 && (!arg2 || !(arg2 == loc2.name)))) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            return loc1;
        }

        public getAllInfo(): Array<any>
        {
            return this._allCopy;
        }

        public getDropBoxByCode(arg1: int): TCopyDropCopyBox
        {
            return this._allCopyDropDic[arg1];
        }

        public getSkillInfoByCopyCodeAndPos(arg1: int, arg2: int): CopySkillInfo
        {
            return this._skills[arg1 + "-" + arg2] as CopySkillInfo;
        }

        public CopyConfig.get skills(): Map<any, any> /* flash.utils.Dictionary */
        {
            return this._skills;
        }

        public getMaterialList(arg1: int): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            var loc4=this._materials;
            for(loc2 of loc4) 
            {
                if (loc2.copyCode != arg1) 
                {
                    continue;
                }
                loc1.push(loc2);
            }
            loc1.sortOn("pos", Array.NUMERIC);
            return loc1;
        }

        /* internal  */getArr(arg1: Array<any>): Array<any>
        {
            var loc1=[];
            var loc2=0;
            while (loc2 < arg1.length) 
            {
                if (loc1.indexOf(arg1[loc2]) == -1) 
                {
                    loc1.push(arg1[loc2]);
                }
                ++loc2;
            }
            return loc1;
        }

        public static get instance(): CopyConfig
        {
            if (CopyConfig._instance == null) 
            {
                CopyConfig._instance = new CopyConfig();
            }
            return CopyConfig._instance;
        }

        public getCurCopySkillList(arg1: int): Array<any>
        {
            var loc1=null;
            if (this._curCopyCode != arg1) 
            {
                this._curCopyCode = arg1;
                this._skillList = new Array<any>();
                var loc2=0;
                var loc3=this._skills;
                for(loc1 of loc3) 
                {
                    if (!(loc1 && loc1.copyCode == arg1)) 
                    {
                        continue;
                    }
                    this._skillList.push(loc1);
                }
                this._skillList.sortOn("pos", Array.NUMERIC);
            }
            return this._skillList;
        }

        public isCurrentCopySkill(arg1: int, arg2: int): Boolean
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._skills;
            for(loc1 of loc3) 
            {
                if (!(loc1.copyCode == arg1 && loc1.itemCode == arg2)) 
                {
                    continue;
                }
                return true;
            }
            return false;
        }

        public getExpByRoleLevel(arg1: TCopy, arg2: int): int
        {
            var loc2=0;
            var loc3=0;
            var loc5=0;
            var loc6=null;
            var loc1=arg1.expConfig.split("#");
            var loc4=0;
            loc2 = 0;
            while (loc2 < loc1.length) 
            {
                loc6 = (loc1[loc2] as string).split(",");
                loc5 = parseInt(loc6[1]);
                if (arg2 > loc4 && arg2 <= parseInt(loc6[0])) 
                {
                    return loc5;
                }
                loc4 = parseInt(loc6[0]);
                ++loc2;
            }
            return 0;
        }

        public getCopyGradeTaskList(): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            var loc4=this._copyGradeTaskDic;
            for(loc2 of loc4) 
            {
                loc1.push(loc2);
            }
            return loc1;
        }

        public getCopyGradeAllTaskAwards(): Array<any>
        {
            var loc2=null;
            var loc1=[];
            var loc3=0;
            var loc4=this._copyGradeTaskAwardsDic;
            for(loc2 of loc4) 
            {
                loc1.push(loc2);
            }
            loc1.sortOn("id");
            return loc1;
        }

        public getCopyGradeInfo(arg1: int): CopyGradeInfo
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            if (!this._copyGradeDic) 
            {
                this._copyGradeDic = new Map<any, any> /* flash.utils.Dictionary */();
                loc2 = this._copyConfigDic["CopyGrade"].item as Array<any>;
                loc3 = 0;
                while (loc3 < loc2.length) 
                {
                    loc1 = new CopyGradeInfo();
                    loc1.level = loc2[loc3]["level"];
                    loc1.levelString = loc2[loc3]["levelString"];
                    loc1.color = loc2[loc3]["color"];
                    loc1.minValue = loc2[loc3]["minValue"];
                    loc1.maxValue = loc2[loc3]["maxValue"];
                    this._copyGradeDic[loc1.level] = loc1;
                    ++loc3;
                }
            }
            var loc4=0;
            var loc5=this._copyGradeDic;
            for(loc1 of loc5) 
            {
                if (!(arg1 >= loc1.minValue && arg1 <= loc1.maxValue)) 
                {
                    continue;
                }
                return loc1;
            }
            return null;
        }

        public getCopyTargetNumDesc(arg1: int): string
        {
            var loc2=null;
            var loc1=this._copyConfigDic["CopyGradeTargetNumDesc"].item as Array<any>;
            var loc3=0;
            var loc4=loc1;
            for(loc2 of loc4) 
            {
                if (!(arg1 >= loc2.minValue && arg1 <= loc2.maxValue)) 
                {
                    continue;
                }
                return loc2.desc;
            }
            return "";
        }

        public getKingCopyToolTipData(arg1: int, arg2: int): KingCopyToolTipData
        {
            var loc2=null;
            var loc3=null;
            var loc1=this._copyConfigDic["KingCopyToolTipData"].item as Array<any>;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (!(arg1 == loc2.copyCode && arg2 == loc2.dropDirection)) 
                {
                    continue;
                }
                (loc3 = new KingCopyToolTipData()).copyName = loc2.copyName;
                loc3.directionName = loc2.directionName;
                loc3.rewards = loc2.rewards;
                break;
            }
            return loc3;
        }

        public getExtraDropCost(arg1: int): int
        {
            var loc1=this._map[arg1] as TCopy;
            if (loc1) 
            {
                return loc1.extraDropCost;
            }
            return 0;
        }

        public getGuildCopyDesc(arg1: int): string
        {
            var loc2=null;
            var loc3=null;
            var loc1=this._copyConfigDic["GuildCopyDescribe"].item;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (loc2["type"] != arg1) 
                {
                    continue;
                }
                return loc3 = (loc3 = (loc3 = loc2["desc"] as string).replace(new RegExp("\\[", "g"), "<")).replace(new RegExp("]", "g"), ">");
            }
            return "";
        }

        public getCopyDesc(arg1: int, arg2: int): string
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            if (arg1 != CopyType.SIXTY_COPY) 
            {
                if (arg1 == CopyType.CROSS_ARYADEVA_SECRET_COPY) 
                {
                    loc1 = this._copyConfigDic["CrossAryadevaSecretCopyDescribe"].item;
                }
            }
            else 
            {
                loc1 = this._copyConfigDic["SixtyCopyDescribe"].item;
            }
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (loc2["type"] != arg2) 
                {
                    continue;
                }
                return loc3 = (loc3 = (loc3 = loc2["desc"] as string).replace(new RegExp("\\[", "g"), "<")).replace(new RegExp("]", "g"), ">");
            }
            return "";
        }

        public getEightyCopyDesc(arg1: int): string
        {
            var loc2=null;
            var loc3=null;
            var loc1=this._copyConfigDic["EightyCopyDescribe"].item;
            var loc4=0;
            var loc5=loc1;
            for(loc2 of loc5) 
            {
                if (loc2["type"] != arg1) 
                {
                    continue;
                }
                return loc3 = (loc3 = (loc3 = loc2["desc"] as string).replace(new RegExp("\\[", "g"), "<")).replace(new RegExp("]", "g"), ">");
            }
            return "";
        }

        public CopyConfig.get seventyCopyConfigDic(): Map<any, any> /* flash.utils.Dictionary */
        {
            if (!this._seventyCopyConfigDic) 
            {
                this.readSeventyCopyConfig();
            }
            return this._seventyCopyConfigDic;
        }

        public getSeventyCopyContext(arg1: int): string
        {
            var loc1=this.seventyCopyConfigDic[arg1] as TSeventyCopyConfig;
            if (loc1) 
            {
                return loc1.context;
            }
            return "";
        }

        public getSeventyCopyConfig(arg1: int): TSeventyCopyConfig
        {
            return this._seventyCopyConfigDic[arg1];
        }

        public isReviveLimit(arg1: int): Boolean
        {
            var loc1=this.seventyCopyConfigDic[arg1] as TSeventyCopyConfig;
            if (loc1) 
            {
                return loc1.reviveLimit == 1;
            }
            return false;
        }

        /* internal  */readSeventyCopyConfig(): void
        {
            var loc2=null;
            var loc3=null;
            this._seventyCopyConfigDic = new Map<any, any> /* flash.utils.Dictionary */();
            var loc1=ConfigManager.instance.getJSONByFileName("t_seventy_copy_config.json");
            var loc4=0;
            var loc5=loc1;
            for(loc3 of loc5) 
            {
                loc2 = new TSeventyCopyConfig();
                loc2.copyCode = loc3.copyCode;
                loc2.spaceId = loc3.spaceId;
                loc2.context = StringHelper.getString(loc3.context);
                loc2.reviveLimit = loc3.reviveLimit;
                loc2.spaceName = StringHelper.getString(loc3.spaceName);
                loc2.describe = StringHelper.getString(loc3.describe);
                loc2.dropItem = StringHelper.getString(loc3.dropItem);
                loc2.interval = loc3.interval;
                loc2.process = loc3.process;
                loc2.timeLimit = loc3.timeLimit;
                loc2.value = loc3.value;
                loc2.valueEx = loc3.valueEx;
                this._seventyCopyConfigDic[loc2.spaceId] = loc2;
            }
            return;
        }

        public get60DefenceConfig(arg1: int, arg2: int, arg3: int): T60DefenseCopyConfig
        {
            return this._sixtyDefenceConfig[arg1 + "_" + arg2 + "_" + arg3];
        }

        public isHighestLevelBoss(arg1: T60DefenseCopyConfig): Boolean
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._sixtyDefenceConfig;
            for(loc1 of loc3) 
            {
                if (!(loc1.copyCode == arg1.copyCode && loc1.type == arg1.type)) 
                {
                    continue;
                }
                if (!(loc1.level > arg1.level)) 
                {
                    continue;
                }
                return false;
            }
            return true;
        }

        public getGuildStruggleConfig(arg1: int, arg2: int): TGuildStruggleConfig
        {
            return this._guildStruggleConfig[arg1 + "_" + arg2] as TGuildStruggleConfig;
        }

        /* internal  */get guildDefenseConfig(): Map<any, any> /* flash.utils.Dictionary */
        {
            if (!this._guildDefenseConfig) 
            {
                this.readGuildDefenseConfig();
            }
            return this._guildDefenseConfig;
        }

        /* internal  */readGuildDefenseConfig(): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            if (!this._guildDefenseConfig) 
            {
                this._guildDefenseConfig = new Map<any, any> /* flash.utils.Dictionary */();
                loc1 = ConfigManager.instance.getJSONByFileName("t_guild_defense_upgrade.json");
                var loc4=0;
                var loc5=loc1;
                for(loc3 of loc5) 
                {
                    loc2 = new TGuildDefenseUpgrade();
                    loc2.difficulty = loc3.difficulty;
                    loc2.type = loc3.type;
                    loc2.level = loc3.level;
                    loc2.material = loc3.material;
                    loc2.preBoss = loc3.preBoss;
                    loc2.targetBoss = loc3.targetBoss;
                    loc2.showIcon = loc3.showIcon;
                    loc2.broadcastMsg = StringHelper.getString(loc3.broadcastMsg);
                    loc2.desc = StringHelper.getString(loc3.desc);
                    this._guildDefenseConfig[loc2.difficulty + "_" + loc2.type + "_" + loc2.level] = loc2;
                }
            }
            return;
        }

        public getGuildDefenseConfig(arg1: int, arg2: int, arg3: int): TGuildDefenseUpgrade
        {
            return this.guildDefenseConfig[arg1 + "_" + arg2 + "_" + arg3];
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_allCopy: Array<any>;

        /* internal */ /* var */_copyConfigDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_allCopyDropDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_materials: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_skills: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_sixtyDefenceConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_guildStruggleConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_copyGradeTaskDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_copyGradeTaskAwardsDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_crossStairDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_heroBattleFormula: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_guildStruggleBossList: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_skillList: Array<any>;

        /* internal */ /* var */_curCopyCode: int;

        /* internal */ /* var */_copyGradeDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_seventyCopyConfigDic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_guildDefenseConfig: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: CopyConfig;

        /* internal */ /* var */_crossTopStair: int;
    }
